package com.psl.services.work;

import com.psl.Dao.Conn;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class updatedj
{
  public boolean savedj(String h_dj, int h_id)
  {
    Connection conn = new Conn().getConn();
    PreparedStatement pstmt = null;
    try
    {
      pstmt = conn.prepareStatement("UPDATE proc_halfproduct set h_dj=? where h_id=?");
      pstmt.setString(1, h_dj);
      pstmt.setInt(2, h_id);
      pstmt.executeUpdate();
      return true;
    }
    catch (SQLException e)
    {
      e.printStackTrace();
    }
    finally
    {
      try
      {
        if (pstmt != null) {
          pstmt.close();
        }
        if (conn != null) {
          conn.close();
        }
      }
      catch (SQLException e)
      {
        e.printStackTrace();
      }
    }
    return true;
  }
}
